import { createStore, applyMiddleware, compose } from 'redux'

// 导入根reducer
import reducer from './reducers/index'

// 导入redux-thunk
import thunk from 'redux-thunk'

// 创建仓库并且导出
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
export default createStore(reducer, composeEnhancers(applyMiddleware(thunk)))
